<template>
	<view class="Agreement">
		<u-navbar :title="navTitle" :autoBack="true" :placeholder="true">
		</u-navbar>

		<view class="content">
			<u-parse :content="content"></u-parse>
		</view>
	</view>
</template>

<script>
	import {
		qryByType
	} from "@/api/api.js"
	export default {
		data() {
			return {
				type: 0,
				navTitle: "",
				content: "",
			}
		},
		onLoad(options) {
			this.type = options.type
			this.navTitle = options.type == 1 ? '用户协议' : '隐私政策'
			this.handleFetqryByType()
		},
		methods: {
			async handleFetqryByType() {
				let res = await qryByType({
					type: this.type,
				})
				this.content = res.data.content
			},
		}
	}
</script>

<style scoped lang="scss">
	.Agreement {
		width: 100%;
		padding: 20rpx;
		box-sizing: border-box;
	}
</style>